name: FastTokenizer

on:
  push:
    paths:
      - 'fast_tokenizer/*'
  pull_request:
    paths:
      - 'fast_tokenizer/*'

jobs:
  fast_tokenizer_cpp:
    name: fast_tokenizer_cpp
    runs-on: ubuntu-22.04
    permissions:
      pull-requests: write
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v3
      - name: compile
        working-directory: ./fast_tokenizer
        run: make fast_tokenizer_cpp_compile
      - name: test
        working-directory: ./fast_tokenizer
        run: make fast_tokenizer_cpp_test
  fast_tokenizer_python38:
      name: fast_tokenizer_python38
      runs-on: ubuntu-22.04
      permissions:
        pull-requests: write
        contents: read
        id-token: write
      steps:
        - uses: actions/checkout@v3
        - uses: actions/setup-python@v1
          with:
            python-version: 3.8
        - name: install
          working-directory: ./fast_tokenizer
          run: make fast_tokenizer_python_install
        - name: compile
          working-directory: ./fast_tokenizer
          run: make fast_tokenizer_python_compile
        - name: test
          working-directory: ./fast_tokenizer
          run: make fast_tokenizer_python_test
  